import Vue from 'vue';
import { isQYWX, isOpenData } from '@src/util/platform';
import platformExtensionFunc from '@src/platform/extension'

import { setTabTitle } from '@src/util/tabTitle.js';

// const FrameView = () => import('./FrameView.vue');
import FrameView from './FrameView.vue';

// 微信配置
// if (window.wx || isOpenData) {
//   platformExtensionFunc.sign()
// }

Vue.component('async-component', function(resolve) {
  if (!window.wx && !isOpenData) {
    resolve(FrameView)
    return
  }
  platformExtensionFunc.sign().then(result => {
    resolve(FrameView)
  }).catch(error => {
    console.error(error)
  })
});

const app = {
  render: h => (<async-component></async-component>)
};

export default app;